﻿using System.Collections.Generic;

namespace WJP.Localization
{
    /// <summary>
    /// 一个空的语言提供器
    /// </summary>
    public class EmptyTranslator : Translator
    {
        public override bool Enable
        {
            get { return false; }
            set { }
        }

        public override IList<string> GetSupportCultures()
        {
            return new List<string>()
            {
                PlatformEnvironment.Configuration.DevCulture
            };
        }

        protected override bool TranslateCore(string devCulture, out string result)
        {
            result = devCulture;
            return true;
        }

        protected override string TranslateReverseCore(string currentCulture)
        {
            return currentCulture;
        }

        protected override void OnCurrentCultureChanged()
        {
            base.OnCurrentCultureChanged();
            this.CurrentCulture = PlatformEnvironment.Configuration.DevCulture;
        }
    }
}